<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <jsp:include page="../header.jsp"></jsp:include>
</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">设备保修</h1>
</header>
<jsp:include page="../commonMenu.jsp"></jsp:include>
<div class="mui-content">
    <input id="nonceStr" type="hidden" value="${info.nonceStr}">
    <input id="paySign" type="hidden" value="${info.paySign}">
    <input id="prepay_id" type="hidden" value="${info.prepay_id}">
    <input id="timeStamp" type="hidden" value="${info.timeStamp}">

    <button id='login' type="button" class="mui-btn mui-btn-block mui-btn-primary" onclick="onBridgeReady()">下单支付
    </button>
</div>
</body>
<jsp:include page="../footer.jsp"></jsp:include>
<script src="${pageContext.request.contextPath}/static/mui/js/echarts-all.js"></script>
<script>
    function onBridgeReady() {
        WeixinJSBridge.invoke(
            'getBrandWCPayRequest', {
                "appId": "wx29b24f43bca3ba85",     //公众号名称，由商户传入
                "timeStamp": $("#timeStamp").val(),        //时间戳，自1970年以来的秒数
                "nonceStr": $("#nonceStr").val(), //随机串
                "package": "prepay_id=" + $("#prepay_id").val(),
                "signType": "MD5",         //微信签名方式：
                "paySign": $("#paySign").val() //微信签名
            },
            function (res) {
                mui.alert("支付结果！" + JSON.stringify(res));
            });
    }
</script>
</html>